﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store/StoreMastePage.Master"  AutoEventWireup="true" CodeBehind="GenerateDisbursementForm.aspx.cs" Inherits="logicunivesityinventorystore.Department.GenerateDisbursementForm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

<script type="text/javascript" language="javascript">
    function printDiv() {

        var toPrint = document.getElementById("divPrint");
        var printWindow = window.open("", "", 'left=500,right=500,width=500,height=500');
        printWindow.document.write('<center>' + toPrint.innerHTML + '</center>');
        printWindow.document.close();
        printWindow.focus();
        printWindow.print();
        printWindow.close();

    }
   </script>

</asp:Content>
<asp:Content ID="Content6" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
        <h1>Generate Disbursement Form</h1>
    <asp:Label ID="lblSelectDept" runat="server" Text="Select Department"></asp:Label>
    &nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="ddlDepartmentName" runat="server" AutoPostBack="True" 
            DataSourceID="ObjectDataSource1" DataTextField="DepartmentName" 
            DataValueField="DepartmentCode" Height="16px" Width="216px">
    </asp:DropDownList>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="FindAll" TypeName="BusinessLogicLayer.DepartmentFacade">
        </asp:ObjectDataSource>
        <br />
        <br />
    <asp:GridView ID="gvDisbursementList" runat="server" AutoGenerateColumns="False" 
        <div id="divPrint">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            Width="547px" BorderStyle="Outset" DataSourceID="ObjectDataSource2" 
            GridLines="None" EmptyDataText="NO Requisition made for this Department">
        <Columns>
            <asp:BoundField DataField="Description" HeaderText="Stationary Name" />
            <asp:BoundField DataField="OrderedQty" HeaderText="Ordered Quantity" />
            <asp:BoundField DataField="ActualQty" HeaderText="Actual Quantity" />
        </Columns>
    </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            SelectMethod="GetDisbursementDetails" 
            TypeName="BusinessLogicLayer.RetrivalListFacade">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddlDepartmentName" Name="departmentCode" 
                        PropertyName="SelectedValue" Type="String" />
                </SelectParameters>
        </asp:ObjectDataSource>
        &nbsp;&nbsp;
        <asp:DetailsView ID="dvDisbursementDetails" runat="server" AutoGenerateRows="False" 
            DataSourceID="ObjectDataSource3" GridLines="None" Height="50px" 
            Width="349px">
            <Fields>
                <asp:BoundField DataField="CollectionPoint" HeaderText="Collection Point" />
                <asp:BoundField DataField="EmployeeName" HeaderText="Representative Name" />
            </Fields>
        </asp:DetailsView>
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
            SelectMethod="GetCollectionPointAndRepresentative" 
            TypeName="BusinessLogicLayer.DepartmentFacade">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlDepartmentName" Name="deptID" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

        <br />
        <br />
    <asp:Label ID="lblSign" runat="server" Text="Sign"></asp:Label>
    &nbsp;&nbsp;
    <asp:Label ID="lblSignature" runat="server" Text="______________________________"></asp:Label>
        <br />
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnPrint" runat="server" CssClass="ButtonStyle" Text="Print"/>
</div>
        <asp:Button ID="btnPrint" OnClientClick="printDiv()" runat="server" 
            CssClass="ButtonStyle" Text="Print" onclick="btnPrint_Click" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <br />
        <br />
            </asp:Content>




